From d3a7711f0c72e302bdbc5a2a1f0fa2649a6b6858 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 1 Apr 2009 16:20:30 +0100 Subject: [PATCH] x86: hvm_*io_intercept() should only update p->count if X86EMUL_OKAY. Signed-off-by: Stefano Stabellini Signed-off-by: Keir Fraser --- xen/arch/x86/hvm/intercept.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/hvm/intercept.c b/xen/arch/x86/hvm/intercept.c index 107b87d2f7..1a1f24c7f6 100644 --- a/xen/arch/x86/hvm/intercept.c +++ b/xen/arch/x86/hvm/intercept.c @@ -100,8 +100,11 @@ static int hvm_mmio_access(struct vcpu *v, } } - if ( (p->count = i) != 0 ) + if ( i != 0 ) + { + p->count = i; rc = X86EMUL_OKAY; + } return rc; } @@ -165,8 +168,11 @@ static int process_portio_intercept(portio_action_t action, ioreq_t *p) } } - if ( (p->count = i) != 0 ) + if ( i != 0 ) + { + p->count = i; rc = X86EMUL_OKAY; + } return rc; } -- 2.30.2